#ifndef TMMYSESSIONCB_H
#define TMMYSESSIONCB_H

#include <QObject>
#include <Glacier2/Glacier2.h>
#include <QDebug>

class TMMySessionCB : public QObject,public Glacier2::SessionCallback
{
    Q_OBJECT
public:
    explicit TMMySessionCB(QObject *parent = 0);

    // 通过 SessionCallback 继承
    virtual void createdCommunicator(const Glacier2::SessionHelperPtr & session) override
    {
        qDebug()<<("[log]: createdCommunicator\n");
//        emit sig_createdCommunicator();
    }
    virtual void connected(const Glacier2::SessionHelperPtr & session) override
    {
        qDebug()<<("[log]: connected\n");
        emit sig_connSuccess();
    }
    virtual void disconnected(const Glacier2::SessionHelperPtr & session) override
    {
        qDebug()<<("[log]: disconnected\n");
        emit sig_disConnected();
    }
    virtual void connectFailed(const Glacier2::SessionHelperPtr & session, const Ice::Exception & ex) override
    {
        qDebug()<<("[log]: connectFailed\n");
        emit sig_connFailed();

    }

signals:
    void sig_createdCommunicator();
    void sig_connSuccess();
    void sig_connFailed();
    void sig_disConnected();
};

#endif // TMMYSESSIONCB_H
